﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">	
		<meta http-equiv="Access-Control-Allow-Origin" content="">
		<meta http-equiv="content-security-policy">
		<link rel="stylesheet" href="../css/mui.min.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link href="../css/base.css" rel="stylesheet" />
		<link href="../css/layout.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/less.css" />
        <script type="text/javascript" src="../../js/mui.min.js"></script>
        <script type="text/javascript" src="../../js/app.js"></script>
		<title>技巧列表</title>
        <script>        	
            (function ($, doc) {
                $.ready(function () {
                    //TypeID： 0小车科目一 1小车科目四 2货车科目一 3货车科目四 4客车科目一 5客车科目四
                    var TypeID = localStorage.getItem("TypeID");
                    showList(TypeID);
                });

                function showList(TypeID) {
                    var postData = {};
                    var param = {};
                    param.TypeID = TypeID;
                    postData.param = JSON.stringify(param);

                    Skill.GetEduPlanContent(postData, function (data) {
                        if (!data.status) {
                            mui.alert(data.msg);
                        } else {
                            var table = document.getElementById("skill-list");
                            table.innerHTML = '';
                            var html = "";
                            for (var i = 0; i < data.rows.length; i++) {
                                var row = data.rows[i];
                                html += '<li class="mui-clearfix">' +
                                    '<i class="iconfont"></i><span>' + row.Name + '</span>' +
                                    '<div class="right">' +
                                        '<a class="mui-btn mui-btn-primary" ContentID="' + row.ContentID + '"  ContentName="' + row.Name + ' 练习" textType="2">练习</a>' +
                                        '<a class="mui-btn mui-btn-primary" ContentID="' + row.ContentID + '"  ContentName="' + row.Name + ' 测试" textType="3">测试</a>' +
                                     '</div></li>';

                               
                            }
                            table.innerHTML = html;

                            var btns = document.getElementsByClassName("mui-btn mui-btn-primary");
                            for (var i = 0; i < btns.length; i++) {
                                btns[i].addEventListener('tap', function (event) {
                                    var ContentID = this.getAttribute("ContentID");
                                    var textType = this.getAttribute("textType");
                                    var ContentName = this.getAttribute("ContentName");
                                    ShowTest(textType, ContentID, ContentName);
                                });
                            }


                          
                        }
                    });
                }
            }(mui, document));
            //打开考试页面
            function ShowTest(textType, ContentID, ContentName) {
                //textType： 1模拟考试 2练习 3测试
                localStorage.setItem("textType", textType);
                localStorage.setItem("ContentID", ContentID);
                localStorage.setItem("ContentName", ContentName);
                openPage('test.html?r=' + Math.random(), 'test');
            }
        </script>
	</head>
	<body>
		<!--
        	作者：198345800@qq.com
        	时间：2017-05-09
        	描述：
        	random-icon-sub1  和 random-icon-sub2  分别是二种图标随机
        -->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">技巧练习</h1>
		</header>
		<div class="mui-content">
	        <div id="pullrefresh">
	            <ul id="skill-list" class="skill-list random-icon-sub1">
	               
	            </ul>
	        </div>
        </div>
	</body>
	
</html>
